package org.neuedu.service.impl;

import com.alibaba.cloud.commons.lang.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.neuedu.entity.MedicalTechnology;
import org.neuedu.mapper.MedicalTechnologyMapper;
import org.neuedu.service.MedicalTechnologyService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lzw
 * @since 2024-11-17
 */
@Service
public class MedicalTechnologyServiceImpl extends ServiceImpl<MedicalTechnologyMapper, MedicalTechnology> implements MedicalTechnologyService {
    @Override
    public List<MedicalTechnology> getByType(String type, String techCode, String techName) {
        QueryWrapper<MedicalTechnology> wrapper = new QueryWrapper<>();
        wrapper.eq("tech_type", type);
        if (StringUtils.isNotBlank(techCode)) {
            wrapper.likeRight("tech_code", techCode);
        }
        if (StringUtils.isNotBlank(techName)) {
            wrapper.like("tech_name", techName);
        }
        return this.list(wrapper);
    }
}
